package com.filmbooks.model.book;

import android.support.annotation.NonNull;

import com.filmbooks.api.DoubanApi;
import com.filmbooks.contract.book.BookDeatilContract;
import com.filmbooks.model.home.bean.book.BookDetailBean;
import com.zyw.horrarndoo.sdk.helper.RetrofitCreateHelper;
import com.zyw.horrarndoo.sdk.helper.RxHelper;

import io.reactivex.Observable;

/**
 * Created by heshuxiang on 2018/3/9.
 * 描述：
 * 公司：盟将威
 * 作者：heshuxiang
 * 日期：2018/3/9.
 * 工程：FilmBooks
 * 包：com.filmbooks.model.book
 */

public class BookDetailModel implements BookDeatilContract.IBookDetailModel {
    @Override
    public Observable<BookDetailBean> getBookDetail(String id) {
        return RetrofitCreateHelper.createApi(DoubanApi.class, DoubanApi.HOST).getBookDetail(id)
                .compose(RxHelper.<BookDetailBean>rxSchedulerHelper());
    }

    @NonNull
    public static BookDetailModel newInstance() {
        return new BookDetailModel();
    }

}
